//
//  XWXViewController.m
//  XWXSqliteTool
//
//  Created by wxxu on 09/20/2017.
//  Copyright (c) 2017 wxxu. All rights reserved.
//

#import "XWXViewController.h"
#import "XWXSqliteManager.h"
#import "XWXTestModel.h"
#import "XWXModel.h"

@interface XWXViewController ()

@end

@implementation XWXViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self testInsertTable];
}

- (void)testInsertTable
{
    XWXTestModel *testModel = [[XWXTestModel alloc] init];
    testModel.name = @"22";
    testModel.codeArea = @"afadfasdfa";
    testModel.cookies = @"123ajadjfalfjaafjasdlfja";
    testModel.age = 26;
    testModel.a = @"aaaaaaa";
    
    NSArray *array = @[@"aaa",@"bbb",@"ccc"];
    testModel.array = array;
    
    NSMutableArray *mutableArray = [[NSMutableArray alloc] initWithArray:array];
    testModel.mutableArray = mutableArray;
    
    NSDictionary *dic = @{@"aa":@"aaaa",@"bb":@"bbbb"};
    testModel.dic = dic;
    
    NSData *imageData = UIImagePNGRepresentation([UIImage imageNamed:@"scroll_delete"]);
    testModel.iamgeData = imageData;
    
    XWXModel *model = [[XWXModel alloc] init];
    model.name = @"name";
    model.a11 = @"a11";
    model.codeArea11 = @"codeArea11";
    model.cookies11 = @"cookies11";
    
    [XWXSqliteManager insertWithModel:testModel withDBName:nil];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
